﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataProcessModule.Protocol
{
    public class TimeRequest : BaseInstruction
    {     

        #region construction

        public TimeRequest()
        {
            instHeadInfo.instID = 0x0118;
        }

        public TimeRequest(byte[] buf)
        {

            int offset = 0;
            // 获取头信息
            GetHeadInfo(buf, ref offset);
            BodyStreamSplit(buf, ref offset);
        }

        #endregion

        #region function

        public void BodyStreamSplit(byte[] buf, ref int offset)
        {
           
        }

        public string CombinedSqlString()
        {
            string _sql = string.Empty;
            _sql = "INSERT INTO table_firebox_asynctime (TerminalKey,AsyncTime) VALUES('" +
                instHeadInfo.tdPhoneNumber + "','" + DateTime.Now.ToString("yyMMddHHmmss") +
                "') ON DUPLICATE KEY UPDATE AsyncTime=VALUES(AsyncTime);";
            return _sql;
        }

        #endregion
    }
}
